package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "de_department_user")
@TableName("de_department_user")
@ApiModel(value = "政府部门用户")
data class DepartmentUser(

        @ApiModelProperty(value = "用户id")
        var userId: String? = null,

        @ApiModelProperty(value = "用户名")
        var accountName: String? = null,

        @ApiModelProperty(value = "登录代码")
        var unitCode: String? = null,

        @ApiModelProperty("区域id")
        var areaId: String? = null,

        @ApiModelProperty("监管部门等级")
        var userLevel: Int? = null,

        @ApiModelProperty("0.政府部门 1.监管部门")
        var type: Int? = 0


) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object {
        private const val serialVersionUID = 1L
    }
}